package com.czmh.etc.onlinepubsys.services.impl;

import com.czmh.etc.onlinepubsys.maper.EtcAfterSaleLogMapper;
import com.czmh.etc.onlinepubsys.model.EtcAfterSaleLog;
import com.czmh.etc.onlinepubsys.services.EtcAfterSaleLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("etcAfterSaleLogService")
public class EtcAfterSaleLogServiceImpl implements EtcAfterSaleLogService {
    @Autowired
    private EtcAfterSaleLogMapper etcAfterSaleLogMapper;

    @Override
    public EtcAfterSaleLog queryObject(String id) {
        return etcAfterSaleLogMapper.queryObject(id);
    }

    @Override
    public List<EtcAfterSaleLog> queryList(Map<String, Object> map) {
        return etcAfterSaleLogMapper.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return etcAfterSaleLogMapper.queryTotal(map);
    }

    @Override
    public int save(EtcAfterSaleLog etcAfterSaleLog) {
        return etcAfterSaleLogMapper.save(etcAfterSaleLog);
    }

    @Override
    public int saveSelective(EtcAfterSaleLog etcAfterSaleLog) {
        return etcAfterSaleLogMapper.saveSelective(etcAfterSaleLog);
    }

    @Override
    public int saveList(List<EtcAfterSaleLog> etcAfterSaleLogs) {
        return etcAfterSaleLogMapper.saveList(etcAfterSaleLogs);
    }

    @Override
    public int update(EtcAfterSaleLog etcAfterSaleLog) {
        return etcAfterSaleLogMapper.update(etcAfterSaleLog);
    }

    @Override
    public int delete(String id) {
        return etcAfterSaleLogMapper.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return etcAfterSaleLogMapper.deleteBatch(ids);
    }

    /**
     * @param orderNo 订单号
     * @return
     */
    @Override
    public int isExistOrderNo(String orderNo) {
        Map<String, Object> queryMap = new HashMap<>();
        queryMap.put("deleteFlag", "0");
        queryMap.put("orderNo", orderNo);
        int count = etcAfterSaleLogMapper.queryTotal(queryMap);
        return count;
    }

}
